package com.axt.dbaudit.base;

public class QueryFilter {
	/*public class Item {
		private String minValue = "";
		private String maxValue = "";
		
		public Item() {
			
		}
		
		public Item(String minValue, String maxValue) {
			this.minValue = minValue;
			this.maxValue = maxValue;
		}
		
		public String getMinValue() {
			return minValue;
		}
		public void setMinValue(String minValue) {
			this.minValue = minValue;
		}
		public String getMaxValue() {
			return maxValue;
		}
		public void setMaxValue(String maxValue) {
			this.maxValue = maxValue;
		}
	}*/
	
	/* 过滤条件的关系 */
	public static final int QUERY_F_RLT_AND = 0;
	public static final int QUERY_F_RLT_OR = 1;
	
	/* 过滤条件的逻辑 */
	public static final int AUDIT_QUERY_F_LOGIC_IS = 0;
	public static final int AUDIT_QUERY_F_LOGIC_NOT = 1;
	
	private int filterType;		/* 过滤类型		*/
	private int filterRelation;	/* And:0, Or:1 	*/
	private int filterLogic;	/* is A:0, not A:1*/
	//private List<Item> filterItems = new ArrayList<Item>();
	private String filterValue = "";
	
	public int getFilterType() {
		return filterType;
	}
	public void setFilterType(int filterType) {
		this.filterType = filterType;
	}
	public int getFilterRelation() {
		return filterRelation;
	}
	public void setFilterRelation(int filterRelation) {
		this.filterRelation = filterRelation;
	}
	public int getFilterLogic() {
		return filterLogic;
	}
	public void setFilterLogic(int filterLogic) {
		this.filterLogic = filterLogic;
	}
	public String getFilterValue() {
		return filterValue;
	}
	public void setFilterValue(String filterValue) {
		this.filterValue = filterValue;
	}
	
	
	/*public void setFilterItems(List<Item> filterItems) {
		this.filterItems = filterItems;
	}
	
	public void appendFilterItem(Item filterItem) {
		filterItems.add(filterItem);
	}*/
	
	/* 返回拼接为字符串的过滤值 */
	/*public String getFilterValue() {
		String filterValue = "";
		
		for (int i = 0; i < filterItems.size(); i ++) {
			if (i > 0)
				filterValue += "$$";
			
			filterValue += filterItems.get(i).minValue;
			filterValue += "##";
			filterValue += filterItems.get(i).maxValue;
		}
		
		return filterValue;
	}*/
	
	/* 从拼接字符串获取过滤值列表 */
	/*public void setFilterValue(String filterValue) {
		this.filterItems = new ArrayList<Item>();
		try {
			String[] list = filterValue.split("$$");
			
			for (int i = 0; i < list.length; i ++) {
				String[] range = list[i].split("##");
				Item item = new Item(range[0], range[1]);
				filterItems.add(item);
			}
		} catch (Exception e) {
		}
	}*/
}
